<?php

/**
 * Subclass for representing a row from the 'causa' table.
 *
 * 
 *
 * @package lib.model
 */ 
class Causa extends BaseCausa
{
	public function __toString()
	{
		return $this->getNombre();
	}
	
	public function getEstadoCausaActivo()
	{
		$criteria = new Criteria();
		$criteria->add(EstadoCausaPeer::ACTIVO,true);
		$criteria->add(EstadoCausaPeer::CAUSA_ID, $this->getId());
		$estadoCausa = EstadoCausaPeer::doSelectOne($criteria);
		
		return $estadoCausa;
	}
	
	public function getAcreedor(){
		return $this->getContrato()->getAcreedor();
	}
}
